home *** CD-ROM | disk | FTP | other *** search
- global gRecipeWindow, gPourWindow
-
- on openPourWindow Initialize
- global gDrinkContentSpr, gLastVessel
- ensurePourWindow()
- if not inMenuMode() and not inBonusMode() then
- restorePourWindowRect()
- open(gPourWindow)
- moveToFront(gPourWindow)
- if gDrinkContentSpr.pLastDirection <> #undocked then
- sendSprite(gDrinkContentSpr, #mShowIfPreviouslyVisible)
- end if
- end if
- if Initialize then
- setPourClockText(" Drink Contents Shown Here", 1)
- gLastVessel = 0
- togglePourClockText(#left, 1)
- end if
- end
-
- on showRecipeAZ
- openRecipeWindow(0, 0)
- sendRecipeWindowTo("Other")
- end
-
- on sendRecipeWindowTo newLabel, onlyIfNew
- global gRecipeWindow
- if recipeWindowAtLabel(newLabel) and onlyIfNew then
- exit
- end if
- tell gRecipeWindow
- if integerp(newLabel) or (label(newLabel) > 0) then
- goToLabel(newLabel)
- end if
- end tell
- end
-
- on refreshRecipes newActiveRecipe
- global gLastCurrent
- if newActiveRecipe then
- sendSprite(barSlotToSprite(newActiveRecipe), #resetRecipe)
- gLastCurrent = newActiveRecipe
- if isWindow(gRecipeWindow) then
- if not isVisible(gRecipeWindow) then
- exit
- end if
- if recipeWindowAtLabel("quickView") then
- sendRecipeWindowTo("quickView", 1)
- else
- if recipeWindowAtLabel("Help") or recipeWindowAtLabel("Help2") then
- nothing()
- else
- if recipeWindowAtLabel("Other") then
- nothing()
- else
- newLabel = "current" & newActiveRecipe
- sendRecipeWindowTo(newLabel)
- end if
- end if
- end if
- end if
- else
- nothing()
- end if
- end
-
- on openRecipeWindow silent, refresh
- global gRecipeWindowOpenTime, gRecipeWindow, gBarTopManager
- ensureRecipeWindow()
- if refresh then
- refreshRecipes(findActiveRecipeSlot())
- end if
- if not isVisible(gRecipeWindow) then
- gRecipeWindowOpenTime = the ticks - gRecipeWindowOpenTime
- end if
- if not inMenuMode() and not inBonusMode() then
- restoreRecipeWindowRect()
- if not silent then
- soundFX("recipe_sound", 0, 0)
- end if
- open(gRecipeWindow)
- moveToFront(gRecipeWindow)
- end if
- end
-
- on ensureRecipeWindow
- global gRecipeWindow
- if not isWindow(gRecipeWindow) then
- gRecipeWindow = window("recipe")
- gRecipeWindow.fileName = the pathName & "recipe"
- gRecipeWindow.windowType = 2
- sourceRect = gRecipeWindow.sourceRect
- gRecipeWindow.rect = rect(the stageLeft, the stageTop, the stageLeft + sourceRect.width, the stageTop + sourceRect.height)
- else
- if intersect((the deskTopRectList)[1], gRecipeWindow.rect) = rect(0, 0, 0, 0) then
- sourceRect = gRecipeWindow.sourceRect
- gRecipeWindow.rect = rect(the stageLeft, the stageTop, the stageLeft + sourceRect.width, the stageTop + sourceRect.height)
- end if
- end if
- end
-
- on ensurePourWindow
- global gPourWindow
- if not isWindow(gPourWindow) then
- gPourWindow = window("pour")
- gPourWindow.fileName = the pathName & "pour"
- gPourWindow.windowType = 2
- sourceRect = gPourWindow.sourceRect
- gPourWindow.rect = rect(the stageRight - sourceRect.width, the stageTop, the stageRight, the stageTop + sourceRect.height)
- else
- if intersect((the deskTopRectList)[1], gPourWindow.rect) = rect(0, 0, 0, 0) then
- sourceRect = gPourWindow.sourceRect
- gPourWindow.rect = rect(the stageRight - sourceRect.width, the stageTop, the stageRight, the stageTop + sourceRect.height)
- end if
- end if
- end
-
- on forgetAllWindows
- closeAllWindows(0)
- repeat while count(the windowList)
- forget(window(1))
- end repeat
- gRecipeWindow = VOID
- gPourWindow = VOID
- end
-
- on toggleHelpWindow itemCode
- ensureRecipeWindow()
- if isVisible(gRecipeWindow) and (recipeWindowAtLabel("Help") or recipeWindowAtLabel("Help2")) then
- rememberPourWindowRect()
- closeRecipeWindow()
- else
- openRecipeWindow(0, 0)
- sendRecipeWindowTo("Help2")
- end if
- refreshHelpWindow(itemCode)
- end
-
- on currentRecipeLabel
- global gLastLabel
- return gLastLabel
- end
-
- on showGeneralHelp newTitle, newText
- openRecipeWindow(0, 0)
- if isWindow(gRecipeWindow) then
- tell gRecipeWindow
- customHelpItem(newTitle, newText)
- end tell
- end if
- end
-
- on showSpecificHelp topicCode
- openRecipeWindow(0, 0)
- if isWindow(gRecipeWindow) then
- tell gRecipeWindow
- updateStage()
- customHelpTopic(topicCode)
- end tell
- end if
- end
-
- on refreshHelpWindow itemCode
- if isWindow(gRecipeWindow) then
- tell gRecipeWindow
- refreshHelpItem(itemCode)
- end tell
- end if
- end
-
- on togglePourWindow
- global gDrinkContentSpr
- if inBonusMode() then
- beginPause()
- MUIalert("The Pour Meter is not used during the Bonus Shot Round")
- endPause()
- exit
- end if
- ensurePourWindow()
- if isVisible(gPourWindow) then
- if not gDrinkContentSpr.visible then
- setPourClockText(VOID, 1)
- gDrinkContentSpr.visible = 1
- else
- closePourWindow()
- end if
- else
- if gDrinkContentSpr.visible then
- sendSprite(gDrinkContentSpr, #mHideDrinkContents)
- else
- openPourWindow(1)
- end if
- end if
- end
-
- on toggleRecipeWindow frameName, silent, refresh
- global gRecipeWindowWarnings, gGameLevel, gRecipeWindowOpenTime
- ensureRecipeWindow()
- if isVisible(gRecipeWindow) and not (recipeWindowAtLabel("Help") or recipeWindowAtLabel("Help2")) then
- waitCursor()
- closeRecipeWindow()
- if draggingAnything() then
- hideCursor()
- else
- resetCursor()
- end if
- else
- if gGameLevel > 1 then
- gRecipeWindowWarnings = gRecipeWindowWarnings + 1
- case gRecipeWindowWarnings of
- 1:
- managerVO("U11")
- 2:
- if not recipeWindowAtLabel("quickView") then
- managerVO("u13")
- end if
- otherwise:
- nothing()
- end case
- end if
- waitCursor()
- openRecipeWindow(silent, refresh)
- sendRecipeWindowTo(frameName, 1)
- end if
- end
-